import time

def s(n):
    sw = True
    while sw:
        sw = False
        for i in range(len(n) -1):
            if n[i] > n[i+1]:
                n[i], n [i + 1]  =  n[i + 1], n[i]
                sw = True

def rl(namefile):
    file = open(namefile, "r")
    data = file.rl()
    return data
    
m1 = rl("/home/student/Рабочий стол/Львов/m1_sorted.txt")
m2 = rl("/home/student/Рабочий стол/Львов/m2_reverse.txt")
m3 = rl("/home/student/Рабочий стол/Львов/m3_shuffle.txt")


ts = time.time()
s(m1)
tf = time.time()
print(round(tf - ts) * 1000)

ts = time.time()
s(m2)
tf = time.time()
print(round(tf - ts) * 1000)

ts = time.time()
s(m3)
tf = time.time()
print(round(tf - ts) * 1000)





    

     
                
